uninit: Avoid buffering the names of all annexed files in memory
authorJoey Hess <joeyh@joeyh.name>
Thu, 11 May 2023 17:25:46 +0000 (13:25 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 11 May 2023 17:25:55 +0000 (13:25 -0400)
Oops, using the same list twice does prevent streaming in constant memory.

Sponsored-by: unqueued on Patreon
CHANGELOG
Command/Uninit.hs

index 7628b5733d745aae623735e8f58c431c89ea9654..09df02f01dfaca27060822de1d10a223f367e47d 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -49,6 +49,7 @@ git-annex (10.20230408) UNRELEASED; urgency=medium
   * reinject: Fix support for operating on multiple pairs of files and keys.
   * importfeed: Support -J
   * importfeed: Support --json-progress
+  * uninit: Avoid buffering the names of all annexed files in memory.
 
  -- Joey Hess <id@joeyh.name>  Sat, 08 Apr 2023 13:57:18 -0400
 
index 48453392f8d04d4f85fbaafaecee3d4da8eb610f..21414b70700e59a9af0a573f66c8d73f073a82d3 100644 (file)
@@ -50,13 +50,13 @@ check = do
 
 seek :: CommandParams -> CommandSeek
 seek = withNothing $ do
-       l <- workTreeItems ww []
        withFilesNotInGit
                (CheckGitIgnore False)
                (WarnUnmatchWorkTreeItems "uninit")
                checksymlinks
-               l
-       withFilesInGitAnnex ww (Command.Unannex.seeker True) l
+               =<< workTreeItems ww []
+       withFilesInGitAnnex ww (Command.Unannex.seeker True)
+               =<< workTreeItems ww []
        finish
   where
        ww = WarnUnmatchLsFiles "uninit"